home *** CD-ROM | disk | FTP | other *** search
- /* CheckUserDataBase.br
- *
- * Script by: Eivind Nordseth, Ultima Thule Software.
- */
-
- /* trace results */
-
- parse arg argument
-
- template = 'BBSNAME/A,DELETE/S'
-
- if (argument = '' | argument = '?') then
- do
- say '$VER: CheckUserDataBase 4.1 (8.8.95)'
- say 'Checks the the users in one or ALL BBSes. If the DELETE switch is used will '
- say 'all users which are impossible to read be marked as deleted.'
- say 'Template:' template
- exit
- end
-
- if ~show('p', 'BBSREAD') then do
- address command
- "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
- "WaitForPort BBSREAD"
- end
-
- address BBSREAD
-
- READARGS template ARGS CMDLINE argument
- if(rc ~= 0) then
- do
- say BBSREAD.LASTERROR
- exit
- end
-
- options failat 31
-
- if upper(ARGS.BBSNAME) = "ALL" then
- do
- GETBBSLIST stem BBSLIST
- if(rc ~= 0) then
- do
- say BBSREAD.LASTERROR
- exit
- end
-
- do n=1 to BBSLIST.COUNT
- call CheckBBS('"'||BBSLIST.n||'"')
- end
- end
- else call CheckBBS('"'||ARGS.BBSNAME||'"')
-
- exit
-
-
- CheckBBS:
- parse arg nameofbbs
-
- say 'Checking:' strip(nameofbbs,'B','"')
-
- GETBBSDATA nameofbbs BBSDATA
- if(rc ~= 0) then
- do
- say BBSREAD.LASTERROR
- exit
- end
-
- do k=BBSDATA.FIRSTUSER to BBSDATA.LASTUSER
-
- READBRUSER nameofbbs k tagsstem TAGS datastem DATA
-
- if(rc ~= 0) then
- do
- Say ' Error reading user' k ':' BBSREAD.LASTERROR
-
- if ARGS.DELETE ~= 0 then
- do
- say ' Marking user as deleted.'
-
- WRITEBRUSER nameofbbs UPDATEUSER k DELETEUSER
- if(rc ~= 0) then
- do
- say ' Unable to mark user as deleted:' BBSREAD.LASTERROR
- end
- end
- end
- end
-
- return
-